'\" te
.\" Copyright (c) 2004, Sun Microsystems, Inc.,
.\" All Rights Reserved
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
.TH USB_PIPE_GET_MAX_BULK_TRANSFER_SIZE 9F "Jan 5, 2004"
.SH NAME
usb_pipe_get_max_bulk_transfer_size \- Get maximum bulk transfer size
.SH SYNOPSIS
.nf
#include <sys/usb/usba.h>



\fBint\fR \fBusb_pipe_get_max_bulk_transfer_size\fR(\fBdev_info_t\fR \fIdip\fR, \fBsize_t *\fR\fIsize\fR);
.fi

.SH INTERFACE LEVEL
illumos DDI specific (illumos DDI)
.SH PARAMETERS
.ne 2
.na
\fB\fIdip\fR\fR
.ad
.RS 8n
Pointer to the device's dev_info structure.
.RE

.sp
.ne 2
.na
\fB\fIsize\fR\fR
.ad
.RS 8n
Returns the bulk transfer size.
.RE

.SH DESCRIPTION
The \fBusb_pipe_get_max_bulk_transfer_size()\fR function returns the maximum
data transfer size in bytes that the host controller driver can support per
bulk request. This information can be used to limit or break down larger
requests to manageable sizes.
.SH RETURN VALUES
.ne 2
.na
\fBUSB_SUCCESS\fR
.ad
.RS 20n
Size is returned in size argument.
.RE

.sp
.ne 2
.na
\fBUSB_INVALID_ARGS\fR
.ad
.RS 20n
\fIdip\fR and/or \fIsize\fR argument is \fBNULL\fR.
.RE

.sp
.ne 2
.na
\fBUSB_FAILURE\fR
.ad
.RS 20n
Size could not be returned. Zero is returned in \fIsize\fR arg.
.RE

.SH CONTEXT
May be called from user, kernel or interrupt context.
.SH EXAMPLES
.in +2
.nf
    int xxx_attach(dev_info_t *dip, int command)
    {
           ...
           usb_pipe_get_max_bulk_transfer_size(dip, &state>max_xfer_size);
           ...
    }

    void xxx_minphys(struct buf bp)
    {
           ...
           if (bp->b_bcount > state->max_xfer_size) {
                   bp->b_bcount = state->max_xfer_size;
           }
           ...
    }


.fi
.in -2

.SH ATTRIBUTES
See \fBattributes\fR(7) for descriptions of the following attributes:
.sp

.sp
.TS
box;
c | c
l | l .
ATTRIBUTE TYPE	ATTRIBUTE VALUE
_
Architecture	PCI-based systems
_
Interface stability	Committed
.TE

.SH SEE ALSO
.BR attributes (7),
.BR usb_alloc_request (9F),
.BR usb_pipe_bulk_xfer (9F),
.BR usb_bulk_request (9S)
